﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class PassController : MonoBehaviour
{
    public Sprite[] sprites;
    public Image gemNum1;
    public Image gemNum2;
    public Image[] scoreNum;
    // Start is called before the first frame update
    void Start()
    {
        int num1 = (int)(GameManage.gemNum / 10);
        if (num1 > 9) {
            num1 = 9;
        }
        gemNum1.sprite = sprites[num1];

        int num2 = GameManage.gemNum % 10;
        gemNum2.sprite = sprites[num2];

        int[] score = new int[8];
        string strScore = PlayerController.gameScore.ToString();
        int j = 0;
        for (int i = strScore.Length - 1; i > 0 ; i--)
        {
            score[i] = int.Parse(strScore[j++].ToString());
        }
        for (int i = 0; i < score.Length; i++)
        {
            scoreNum[i].sprite = sprites[score[i]];
        }
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
